home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / ASAP / ASAP.readme < prev    next >
Encoding:
Text File  |  1998-04-17  |  3.9 KB  |  91 lines

  1. Short:    ASAP - Amiga Software Authoring Platform
  2. Author:   hfx@fox.nstn.ca
  3. Uploader: hfx@fox.nstn.ca
  4. Version:  1.0 beta (final beta)
  5. Type:     dev/c
  6. Requires: Storm or SAS C++. GNUC++ support is being investigated
  7.  
  8. What: Zero overhead, inlined C++ wrapper classes for the Amiga API.
  9.       A collection of 90 header files, each having one class which derive
  10.       from the corresponding Amiga system structure, adding no data members,
  11.       only inlined methods which call the corresponding global prototype
  12.       substituting the 'this' pointer for the structure pointer.
  13.  
  14. Why: I'm a C++ programmer, and I think in terms of objects. The Amiga API
  15.      is a "flat" API. It helps me, and I hope many of you, to categorize these
  16.      functions into "classes" or "categories". Many of you may be concerned about
  17.      overhead using these. See below, there is absolutely *no* overhead. There are
  18.      several benefits, including fewer bugs, such as CloseWindow(pNotAWindow); Also,
  19.      if you want to work with a Window, or RastPort, for instance, you needn't worry
  20.      about what include's you need, just:
  21.        
  22.      #include <ASAP/Window.h>
  23.      #include <ASAP/RastPort.h>
  24.  
  25. How: A tool called ClassBuilder which I wrote for this purpose.
  26.  
  27. When: Part time work started in late January.
  28.  
  29. How it works: Firstly, there is no run time overhead when your compiler allows
  30.               inline optimization. In effect, these are a lot of #define's. As far
  31.               as storage is concerned, these classes *are* the Amiga structures.
  32.               You can treat these classes 100% as if they were the Amiga structures,
  33.               because ultimately, they are.
  34.  
  35.               Consider a structure, "Structure". There are some functions
  36.               which operate upon it, for example OpenStructure(Structure *) and
  37.               CloseStructure(Structure *). To simplify this for the beginner and
  38.               those who grow tired of typing, I write the following code:
  39.  
  40.               class AStructure : public Structure
  41.               {
  42.                public:
  43.                void Open() { ::OpenStructure(this); }
  44.                void Close() { ::CloseStructure(this); }
  45.               }; 
  46.  
  47.               Now the instance is tied to its methods, and there is less typing.
  48.               Also, I have overloaded operator new and delete where desirable.
  49.               Now you can create/destroy a window as follows:
  50.  
  51.               AWindow *pThis_Window = new(&The_NewWindow) AWindow;
  52.               delete pThis_Window;
  53.             
  54.               instead of:
  55.  
  56.               struct Window *pThis_Window = OpenWindow(&The_NewWindow); 
  57.               CloseWindow(pThis_Window);
  58.  
  59. Updates: These have all been compiled, but there might be one or two
  60.          logic errors (perhaps in the more obscure classes).
  61.  
  62.          Second version of the collection with abbreviated names for
  63.          those who do not mind alias of the Amiga API functions.
  64.  
  65.          eg. pThis_Window->Zip(); // instead of pThis_Window->ZipWindow();
  66.  
  67.          Also, default parameters, where the OS defines special parameter
  68.          values or they are otherwise meaningful, must be added.
  69.  
  70. Future:  This collection is fairly comprehensive, but not complete. I'm relying
  71.          on you for feedback. Also, this is just phase I. I've got some nice code
  72.          built on top of this to allow simple, dynamic IDCMP/Boopsi event handling
  73.          (dispatching) which I hope to release some time this summer.
  74.  
  75. Important:
  76.  
  77. Please, please email me if you have any problems or suggestions/complaints.
  78.  
  79. In SAS/C++, create a directory called ASAP in your cxxinclude directory
  80. Decompress the archive into this directory.
  81.  
  82. In Storm C, create a directory as above, but put it whereever you want,
  83. only make certain the directory is in your include path.
  84.  
  85. The files should be reachable by, for example:
  86.  
  87. #include <ASAP/Window.h>
  88.  
  89. Sorry, there is no example in this archive, but I will post one or
  90. more soon.
  91.